﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OpenSoftStore.Client.UIL.UserControls
{
    class YhSoftDateTimePicker : DateTimePicker
    {
        public YhSoftDateTimePicker()
        {
            this.KeyUp += new KeyEventHandler(KeyUps);
            //this.ForeColor = Color.FromArgb(51, 102, 0);
        }

        private void KeyUps(object sender, KeyEventArgs e)
        {
            var findForm = FindForm();
            if (findForm == null) return;
            if (e.KeyCode == Keys.Enter)
            {
                findForm.TabIndex = TabIndex + 1;
                findForm.SelectNextControl(this, true, true, true, true);
            }
        }
    }
}
